<template>
  <div>
    <myheader></myheader>
    <br><br>
    <!-- 面包屑导航 -->
    <Breadcrumb :datas='datas'></Breadcrumb>
    <br><br>
    <br><br>

    <el-form ref="userform" :model='pics'
             label-position="left"
             label-width="80px">
      <el-form-item label="活动标题">
        <el-input v-model="pics.title"></el-input>
      </el-form-item>
      <el-form-item label="跳转地址">
        <el-input v-model="pics.link"></el-input>
      </el-form-item>
      <el-form-item label="宣传图片">
        <el-input v-model="pics.img"></el-input>
      </el-form-item>
      <el-button type="primary" @click="insert">确认修改</el-button>
    </el-form>

    <br><br>
    <br><br>
    <br><br>
    <br><br>
    <br><br>
    <br><br><br>
    <myfooter></myfooter>

  </div>
</template>


<script>
  import myheader from './myheader.vue';
  import myfooter from './myfooter.vue';
  import axios from 'axios'

  export default {
    data() {
      return {
        datas: [{title: '首页', route: {name: 'index'}}, {title: '修改活动页面'}],
        pics: {
          "title": '',
          "link": '',
          "img": '',
        }
      }
    },
    //注册组件标签
    components: {
      'myheader': myheader,
      'myfooter': myfooter,
    },
    methods: {
      insert() {
        axios.post('http://127.0.0.1:8000/updatetpics/', this.pics).then(res => {
          this.$Message(res.data.message);
        })
      }
    }
  }

</script>
